package com.happyclub.lbjdao;


import com.happyclub.pojo.TbActivityCommont;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;


public interface ActivityCommont extends JpaRepository<TbActivityCommont,String> {

    @Query(value = "SELECT c.*,u.NICK_NAME from TB_ACTIVITY_COMMONT c INNER JOIN TB_USER u on c.USER_ID= u.USER_ID where c.ACTIVITY_ID =:activityId ORDER BY c.CREATE_TIME desc",nativeQuery = true)
    List<TbActivityCommont> findActivityById(@Param("activityId") String activityId);
}
